#SingleInstance

FTPcfg = %A_ScriptDir%\ftp.cfg
FTPCommandFile = %A_ScriptDir%\FTPCommands.txt
FTPLogFile = %A_ScriptDir%\FTPLog.txt
FileDelete %FTPCommandFile%  ; In case previous run was terminated prematurely.


		;IniRead, l_pswd,%FTPcfg%,%g_key%,password
		;IniRead, l_id,%FTPcfg%,%g_key%,id
	 	;IniRead, l_ip,%FTPcfg%,%g_key%,ip


FileAppend,  ; The comma is required in this case.
(
open FMSEMEA.BOULDER.IBM.COM
C214612
Ap2j7z1Q
ASC
delete 'C214612.test.JCL'
put put.jcl 'C214612.test.JCL'
quote SITE FILETYPE=JES
get 'C214612.TEST.JCL'
quit
), %FTPCommandFile%



RunWait %comspec% /c ftp.exe -s:"%FTPCommandFile%" >"%FTPLogFile%"
;FileDelete %FTPCommandFile%  ; Delete for security reasons.
Run %FTPLogFile%  ; Display the log for review.